Skip to content

feat(celestia-node-fiber): Listen takes fromHeight for resume-from-height subscriptions#3283

Merged
julienrbrt merged 1 commit intoevstack:julien/fiberfrom
walldiss:feat/fibre-listen-from-height
Apr 23, 2026
Merged

feat(celestia-node-fiber): Listen takes fromHeight for resume-from-height subscriptions#3283
julienrbrt merged 1 commit intoevstack:julien/fiberfrom
walldiss:feat/fibre-listen-from-height

Conversation

@walldiss
Copy link
Copy Markdown

Summary

Threads a `fromHeight uint64` parameter through the Fibre DA Listen path so a subscriber can rejoin the stream from a past block height without missing blobs. Consumes the matching celestia-node API change landed in celestiaorg/celestia-node#4962, which gave `Blob.Subscribe` a `fromHeight` argument backed by a `WaitForHeight` loop.

API change

```go
// block/internal/da/fiber

  • Listen(ctx context.Context, namespace []byte) (<-chan BlobEvent, error)
  • Listen(ctx context.Context, namespace []byte, fromHeight uint64) (<-chan BlobEvent, error)
    ```
  • `fromHeight == 0` — preserve existing "follow from chain tip" semantics.
  • `fromHeight > 0` — replay events from that block forward. Historical heights return immediately; future heights block until the chain advances.

Why

Followers restarting (crashes, rolling updates, lagging nodes) need to pick up blobs they missed while offline. Before this change, a restart either replayed nothing (missed blobs) or required a separate `GetAll`-per-height catchup pathway. Blob.Subscribe from celestia-node#4962 makes the resume path first-class; this PR surfaces it through ev-node's DA abstraction.

What ships

File Change
`block/internal/da/fiber/types.go` `DA.Listen` signature + doc
`block/internal/da/fibremock/mock.go` Replay matching blobs with `height >= fromHeight` before attaching live subscriber
`block/internal/da/fiber_client.go` Outer `fiberDAClient.Subscribe` passes `0` to `fiber.Listen` — `datypes.DA.Subscribe` doesn't plumb a starting height yet, so resume at the outer layer is a future change
`tools/celestia-node-fiber/listen.go` Adapter's `Listen` propagates `fromHeight` to `client.Blob.Subscribe`
`tools/celestia-node-fiber/go.mod` Bump celestia-node to the merged ref from #4962 (`v0.0.0-20260423143400-194cc74ce99c`)
`tools/celestia-node-fiber/adapter_test.go` `fakeBlob.subscribeFn` gets `fromHeight`; assertion that `0` is forwarded
`tools/celestia-node-fiber/testing/showcase_test.go` `TestShowcase` passes `fromHeight=0`; new `TestShowcaseResume` end-to-end test

Verified

  • `go build -tags fibre ./...` clean
  • `go vet -tags fibre ./...` clean
  • `go test -count=1 ./...` — unit tests pass
  • `go test -tags fibre -count=1 ./testing/...` — `TestShowcase` (single-val end-to-end) + `TestShowcaseResume` both pass in ~16s total

TestShowcaseResume sample output

```
phase1 upload[0] blob_id=00f005a3... height=111
phase1 upload[1] blob_id=002222b7... height=111
phase1 upload[2] blob_id=00d4ba53... height=112

resume fromHeight=111

phase2 listen[1/3] blob_id=00f005a3... height=111 data_size=13
phase2 listen[2/3] blob_id=002222b7... height=111 data_size=13
phase2 listen[3/3] blob_id=00d4ba53... height=112 data_size=13
```

All 3 historical blobs replayed from `fromHeight=111` with correct heights and DataSize.

Follow-up

Plumbing `fromHeight` through `datypes.DA.Subscribe` so the sequencer / follower layers can surface it end-to-end. That change is broader than the Fibre-specific plumbing here; keeping the scope tight.

🤖 Generated with Claude Code

…ptions

Threads a fromHeight parameter through the Fibre DA Listen path so a
subscriber can rejoin the stream from a past block height without
missing blobs. Consumes the matching celestia-node API change landed
in celestiaorg/celestia-node#4962, which gave Blob.Subscribe a
fromHeight argument backed by a WaitForHeight loop.

Changes:

- block/internal/da/fiber/types.go: DA.Listen signature now takes
  fromHeight uint64. fromHeight == 0 preserves "follow from tip"
  semantics, >0 replays from that block forward.
- block/internal/da/fibremock/mock.go: replay matching blobs with
  height >= fromHeight before attaching the live subscriber.
- block/internal/da/fiber_client.go: outer fiberDAClient.Subscribe
  does not yet expose a starting height (datypes.DA doesn't plumb
  one), so pass 0 and defer resume-from-height wiring to a future
  datypes.DA change.
- tools/celestia-node-fiber/listen.go: propagate fromHeight to
  client.Blob.Subscribe on the celestia-node API.
- tools/celestia-node-fiber/go.mod: bump celestia-node to the merged
  pseudo-version (v0.0.0-20260423143400-194cc74ce99c) carrying #4962.
- tools/celestia-node-fiber/adapter_test.go: fakeBlob.subscribeFn
  gets the new fromHeight arg; TestListen_FiltersFibreOnlyAndEmitsEvent
  asserts that fromHeight=0 is forwarded.
- tools/celestia-node-fiber/testing/showcase_test.go: existing
  TestShowcase passes fromHeight=0. New TestShowcaseResume uploads 3
  blobs, discovers their settlement heights via a live Listen, then
  opens a fresh Listen with fromHeight at the first blob's height and
  verifies every historical blob is replayed with correct Height and
  DataSize.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 084fe5a5-e34d-4e9c-a2ca-fe837ac2baf2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@julienrbrt julienrbrt merged commit d24af8f into evstack:julien/fiber Apr 23, 2026
16 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants